<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>接口转调</title>
</head>

<body>

    <button id="cherry">调用接口</button>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script src="https://www.jq22.com/jquery/jquery-2.1.1.js"></script>

    <script>

        const cherry = document.getElementById('cherry');

        cherry.onclick = function () {
        
            // $.ajax({
            //     url: 'http://service-js9pym6k-1251317796.gz.apigw.tencentcs.com/release/sos/prod/RedseaPlatform/getPageAjax/bill_shop_settle_details/CoreRequest.mob',
            //     type: 'post',
            //     headers: {
            //         // 'Content-Type': 'application/json; charset=UTF-8'
            //     },
            //     data: {
            //         "startBillDate": "2021-08-01 00:00:00",
            //         "endBillDate": "2021-08-31 23:59:59",
            //         "start": 1,
            //         "pageSize": 15
            //     },
            //     complete(res) {
            //         console.log(res);
            //     }
            // })



            axios({
                url: 'http://service-3usq9a5g-1252766715.gz.apigw.tencentcs.com/release/transfer',
                method: 'post',
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
                },
                data: { 
                    "url": "https://sos.lacesar.com/RedseaPlatform/getPageAjax/bill_shop_settle_details/CoreRequest.mob", 
                    "method": "get", 
                    "header": {}, 
                    "body": { 
                        "startBillDate": "2021-08-01 00:00:00", 
                        "endBillDate": "2021-08-31 23:59:59",
                        "start": 1, 
                        "pageSize": 15
                    }
                }
            }).then(res => {
                console.log(res);
            }).catch(err => {
                console.error(err);
            })
        }

    </script>
</body>

</html>